// JORGE FERNANDO GOMEZ
// 1259371
// 189631
// LEC A1
// MARTIN MÜLLER
// D02
// YANG LIU


#ifndef UTIL_C
#define UTIL_C 1

#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>

#include "figStack.h"

/* Struct to maintain open streams. */
struct Streams {
    char stream_type;   /* 'f' or 'p'. */
    void ** streamptr;
    struct Streams * next;
};


/* FUNCTION PROTOTYPES. */
/* Please see ./util.c for more information. */

void addStream ( void * stream, char type, int issketchpad );

void closeStreams ( void );

void kill ( FigStack * Figures, int numStacks, int numLine );

/* Finds number parameters on an alphanumeric string. */
double* getDoubles ( char * string, int blocks2skip, int count );

/* Creates a substring from string and returns a pointer to it. */
char* substr (const char * string, int offset, int length);

/* Removes trailing whitespace (as defined by isspace()) from lineString. */
void chompim (char * lineString);


/* Prototypes for popen() and pclose() */
FILE * popen (const char *, const char *);
int pclose (FILE *);

#endif /* end of include guard: UTIL_C */
